When you want to free up memory by releasing purgeable icon data from the cache, the preferred method is to use the function FlushIconRefs. You may also use the function FlushIconRefsByVolume, but this has two potential problems:
The additional scope of the FlushIconRefsByVolume
function means it will take longer to complete.
Using the the FlushIconRefsByVolume
function makes the icon data of all currently used IconRefs
non-purgeable. This means any subsequent efforts to flush icon data will be much less effective.